package ualrcdg.shared.requests;

/**
 * Simple implementation of the "Authenticate Player Request" object. See CDG XML Specifications: Server Requests: Authenticate Player.
 */
public class AuthenticatePlayerRequest extends CDGRequest
{
	public static final String requestTag = "authticatePlayer";
	public static final String dtdName = "playerOperations.dtd"; 
	
	public final String username;
	public final String password;

	/**
	 * Primary constructor
	 *
	 * @param requestId the requestId of the AuthenticatePlayerRequest object to be created
	 * @param username the username of the AuthenticatePlayerRequest object to be created
	 * @param password the password of the AuthenticatePlayerRequest object to be created
	 */
	public AuthenticatePlayerRequest( String requestId, String username, String password )
	{
		super( requestId );
		
		if( username == null || password == null )
		{
			throw new NullPointerException( "AuthenticatePlayerRequest: unable to create request. Null parameters not allowed." );
		}

		this.username = username;
		this.password = password;
	}

	/*
	 * @see ualrcdg.shared.requests.CDGRequest#toString()
	 */
	@Override
	public String toString( )
	{
		return "AuthenticatePlayerRequest [<" + super.toString( ) + "> username=" + username + ", password=" + password + "]";
	}
}
